home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / CALib & You… / Source / CASample / CAS_StringTools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-07  |  2.2 KB  |  72 lines  |  [TEXT/MPS ]

  1. /*
  2.  
  3.     File:        CAS_StringTools.h
  4.  
  5.     Contains:    Header for string utility routines.
  6.  
  7.     Written by:    David H Nelson
  8.  
  9.     Copyright © 1988-1995 ComponentWorks, All rights reserved.
  10.  
  11.     Change History (most recent first):
  12.  
  13.          <1>     1988    DHN        Created.
  14.  
  15. */
  16.  
  17. #if !defined(_H_stringTools)
  18. #define _H_stringTools
  19.  
  20.  
  21. //----------------------------------------------------------------------
  22. // MaxTextLength is not 32767 since apparently TextEdit uses a terminator byte.
  23. #define kMaxTextLength    ((unsigned long)32700)
  24.  
  25.  
  26. #if defined(__cplusplus)
  27. extern "C"
  28. {
  29. #endif
  30.  
  31. //----------------------------------------------------------------------
  32. StringPtr ctopstr(char *s);
  33. char *ptocstr(Str255 s);
  34.  
  35. //----------------------------------------------------------------------
  36. /* stringTools.c */
  37. StringPtr sGetResString(short iResID,short iStringID);
  38. short iStrPos(Str255 s, char c);
  39. char cUpperCase(char c);
  40. StringPtr sParamStr(Str255 theStr, Str255 s0, Str255 s1, Str255 s2, Str255 s3, Str255 s4, Str255 s5, Str255 s6, Str255 s7, Str255 s8, Str255 s9);
  41. void NumToEstimatedTimeString(long TimeLeft,Str63 sTimeLeft);
  42. void NumToTimeLeftString(long TimeLeft, Str63 sTimeLeft);
  43. void NumToThousandString(long theLong, Str63 sThousandString);
  44. void ThousandStringToNum(Str63 sThousandString, long *theLong);
  45. void NumToKString(long theLong, Str63 sKString);
  46. void NumToSizeString(long theLong, Str63 sSizeString);
  47. StringPtr sCopyStr(Str255 sSrc,Str255 sDst);
  48. StringPtr sClearStr(Str255 sSrc,short iLength);
  49. StringPtr sAppendStr(Str255 sSrc,Str255 sDst);
  50. StringPtr sNullStr(void);
  51. StringPtr sTrimText(StringPtr sSrc,StringPtr sDst,short iMaxWidth);
  52. StringPtr sFilterStr(StringPtr sSrc,StringPtr sDst);
  53. StringPtr sAppendHexChar(char c0,StringPtr sDst);
  54. StringPtr sAppendHexShort(short i0,StringPtr sDst);
  55. StringPtr sAppendHexLong(long l0,StringPtr sDst);
  56. StringPtr sAppendHexToStr(StringPtr sDst,Ptr pBuffer,long lLength);
  57. StringPtr sHexToStr(StringPtr sDst,Ptr pBuffer,long lLength);
  58. Ptr pPluralStrC(Boolean bS);
  59. StringPtr sPluralStr(Boolean bPlural);
  60. Boolean bStrCmp(StringPtr src,StringPtr dst);
  61. Boolean bCStrCmp(char *src,char *dst);
  62. void drawInfoLine(StringPtr sField, StringPtr sValue, short iJust);
  63. void drawRJInfoLine(StringPtr sField,StringPtr sValue);
  64.  
  65. #if defined(__cplusplus)
  66. }
  67. #endif
  68.  
  69.  
  70. #endif
  71.  
  72.